package com.pearl.jacksoncore.demo.databind.ser;

import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;

/**
 * @author TD
 * @version 1.0
 * @date 2024/3/21
 */
public enum GenderEnum {

    MAN("man", "男"),

    WOMAN("woman", "女");

    private final int _mask;

    public int getMask() {
        return _mask;
    }

    GenderEnum(String code, String desc) {
        System.out.println("构造执行...........");
        System.out.println("序号：" + this.ordinal());
        System.out.println("1 转为二进制："+Integer.toBinaryString(1));
        System.out.println("序号转为二进制："+Integer.toBinaryString(this.ordinal()));
        System.out.println("按位左移（1 << 序号）二进制结果："+Integer.toBinaryString(1 << 25));
        System.out.println("按位左移（1 << 序号）十进制结果："+(1 << 25));
        this._mask = 1 << this.ordinal();
        this.code = code;
        this.desc = desc;
    }

    private String code;

    private String desc;

    @Override
    public String toString() {
        return desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}